// API响应基础类型
export interface BaseResponse<T = any> {
  code: number;
  message: string;
  data: T;
  success: boolean;
}

// 分页响应类型
export interface PaginatedResponse<T = any> extends BaseResponse<{
  list: T[];
  total: number;
  page: number;
  pageSize: number;
  totalPages: number;
}> {
  data: {
    list: T[];
    total: number;
    page: number;
    pageSize: number;
    totalPages: number;
  };
}

// 列表响应类型
export interface ListResponse<T = any> extends BaseResponse<T[]> {}

// 错误响应类型
export interface ErrorResponse {
  code: number;
  message: string;
  timestamp?: string;
  path?: string;
}

// 请求参数类型
export interface RequestParams {
  [key: string]: any;
}

// 分页请求参数
export interface PaginationParams {
  page?: number;
  pageSize?: number;
  sortBy?: string;
  sortOrder?: 'asc' | 'desc';
}

// 上传文件参数
export interface UploadFileParams {
  file: File;
  onUploadProgress?: (progressEvent: any) => void;
  [key: string]: any;
}

// 下载文件参数
export interface DownloadFileParams {
  filename?: string;
  [key: string]: any;
}